import React, { Component } from 'react';
import Search from './components/Search';
import List from './components/List';
export default class App extends Component {
  state = {
    users:[],
    isFirst: true,
    isLoading: false,
    err: '',
  }

  // saveUsers = (users) => { //接收子传过来的数据存state
  //   this.setState({users})
  // }
  updataAppState = (stateObj) => {
    this.setState(stateObj)
  }

  render() {
    return (
      <div className="container">
        <Search updataAppState={this.updataAppState}></Search>
        <List {...this.state}></List>
      </div>
    )
  }
}